package com.yu8home.asyc.service.impl;

import cn.hutool.core.thread.ThreadUtil;
import com.yu8home.asyc.service.BbService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class BbServiceImpl implements BbService {

    @Async
    @Override
    public void b() {
        log.info("BbServiceImpl.b...");
        x();
        ThreadUtil.sleep(5 * 1000);
        log.info("BbServiceImpl.b!!!");
    }

    @Async
    public void x() {
        log.info("BbServiceImpl.x...");
        ThreadUtil.sleep(5 * 1000);
        log.info("BbServiceImpl.x!!!");
    }

}
